# -*- coding: utf-8 -*-
"""
Created on Thu Sep 19 10:57:38 2019

@author: Administrator
"""

# 1029 旧键盘
# 按照发现顺序输出差异的字母
# 考虑存储数据结构：
# set?不合适，因为set保持不了原顺序，按照递增的顺序排列
# list，存储差异的字符

def test():
    # 输入保证非空
    origin_list = list(input())
    broken_list = list(input())
    temp = []
    result = []
    
    while len(broken_list) != 0:
        if origin_list[0] not in temp:
            if origin_list[0] != broken_list[0]:
                temp.append(origin_list.pop(0))
            else:
                origin_list.pop(0)
                broken_list.pop(0)
        else:
            origin_list.pop(0)
    else:
        for ele in origin_list:
            if ele not in temp:
                temp.append(ele)
#    print(result)
    for ele in temp:
        if ele.isdigit():
            result.append(ele)
        else:
            ele_upper = str(ele).upper()
            if ele_upper not in result:
                result.append(ele_upper)
        
    print("".join(result))
            
test()
